import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "../views/Home.vue";
import Login from "../views/Login.vue";

Vue.use(VueRouter);

const routes = [
  // {
  //   path: "/",
  //   name: "Home",
  //   component: Layout,
  //   redirect: "/tally",
  //   children: [
  //     { path: "tally", component: () => import("../views/RouterA.vue") },
  //     {
  //       path: "home",
  //       component: () => import("../views/Home.vue"),
  //       children: [
  //         { path: "tally", component: () => import("../views/RouterA.vue") },
  //       ],
  //     },
  //     { path: "RouterC", component: () => import("../views/RouterC.vue") },
  //     { path: "RouterB", component: () => import("../views/RouterB.vue") },
  //     {
  //       path: "vertical-work",
  //       component: () => import("../views/WorkBenchVertical.vue"),
  //     },
  //   ],
  // },
  {
    path: "/tally",
    name: "tally",
    // component: Login,
    component: () => import("../views/RouterA.vue")
  },
  {
    path: "/station",
    name: "station",
    component: () => import("../views/RouterB.vue")
  },
  {
    path: "/empty",
    name: "empty",
    component: () => import("../views/RouterC.vue")
  },
  {
    path: "/location_audit",
    name: "empty",
    component: () => import("../views/RouterD.vue")
  },
  {
    path: "/permission",
    name: "Login",
    component: Login,
  },
];

const router = new VueRouter({
  routes,
});

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};

export default router;
